package com.xmh.test.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.xmh.test.dao.SexVideoDAO;

@Controller
@RequestMapping(value = "/video", produces = "application/json;charset=UTF-8")
@CrossOrigin
public class SexVideoAction {

	@Autowired
	private SexVideoDAO dao;

	@RequestMapping("/page")
	public String loginPage() {
		return "sexVideo";
	}

	@RequestMapping("/getData")
	@ResponseBody
	public List<Map<String, Object>> getData(Integer index, Integer sum) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("pageIndex", index);
		map.put("pageNumber", sum);

		return dao.selectPageList(map);
	}
}
